<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE HTML PUBLIC "" "">
<f:view xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:w="http://www.apusic.com/jsf/widget" xmlns:layout="http://www.apusic.com/jsf/layout"
	xmlns:h="http://java.sun.com/jsf/html" xmlns:ajax="http://www.apusic.com/jsf/ajax"
	renderKitId="AJAX">
	<w:head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<w:stylesheet src="/css/kmp4.css" type="text/css"></w:stylesheet>
		<w:script src="/javascript/k4.js" type="text/javascript" language="UTF-8"></w:script>
		<script>
		    function deleteConfirm(){
			if(commonKeyGrid.getSelections().length == 0){
				alert("请选择一条记录！");
				return false;
			}
			return showConfirm('你确定要删除吗？');
		}
		</script>
	</w:head>
	<w:page title="配置项一览">
		<layout:panel border="false" autoHeight="true" autoWidth="true" header="false"
			styleClass="k4-view">
			<layout:panel id="viewtoolbar" border="false" autoHeight="true" autoWidth="true">
				<w:form>
					<w:toolBar>
						<w:button label="编辑"
							image="#{facesContext.externalContext.requestContextPath}/images/edit.gif" id="editCommonKey" />
						<w:separator />
						<w:button label="删除"
							image="#{facesContext.externalContext.requestContextPath}/images/delete.gif"
							id="deleteCommonKey" onclick="return deleteConfirm();" />
					</w:toolBar>
				</w:form>
			</layout:panel>
			<layout:panel border="false" autoHeight="true" autoWidth="true" styleClass="k4-view-search">
				<w:form>
					<layout:panelGrid columns="5" width="95%" styleClass="k4-view-searchForm" cellpadding="0"
						cellspacing="0">
						<layout:cell style="width: 85px">
							<h:outputText value="配置项名称" />
						</layout:cell>
						<layout:cell>
							<w:textField width="150" id="keywords" requiredTrim="true"></w:textField>
						</layout:cell>
						<layout:cell style="width: 85px">
							<h:outputText value="配置项类型" />
						</layout:cell>
						<layout:cell>
							<w:combo styleClass="k4-form-textfield" id="commonKeyType" editable="false"></w:combo>
						</layout:cell>
						<layout:cell>
							<layout:panelGrid columns="2" cellpadding="0" cellspacing="0">
								<w:button id="query" value="搜索" image="/images/search.gif" />
								<w:button id="reset" value="重置" immediate="true" image="/images/clear.gif" />
							</layout:panelGrid>
						</layout:cell>
					</layout:panelGrid>
				</w:form>
			</layout:panel>
			<w:dataGrid id="commonKeyGrid" toolBarPosition="bottom" rows="20" paged="true" forceFit="true"
				border="false" showRowNumber="true" styleClass="k4-view-datagrid" autoHeight="true"
				singleSelect="true" jsvar="commonKeyGrid">
				<ajax:action event="ondblclick" id="showCommonKey" />
				<w:outputColumn id="keyValue" header="配置项名称" width="300"></w:outputColumn>
				<w:outputColumn id="keyType" header="配置项类型" width="100" converter="commonKeyTypeFormatter"></w:outputColumn>
				<w:outputColumn id="enabled" header="是否有效" width="80" converter="yesNoFormatter"></w:outputColumn>
				<w:outputColumn id="checkEnable" header="是否可选" width="80" converter="yesNoFormatter"></w:outputColumn>
				<w:outputColumn id="indexNumber" header="序号" width="50"></w:outputColumn>
				<w:pagingToolbar for="commonKeyGrid" displayInfo="true" displayMsg="显示 {0} - {1}，共 {2} 条" />
			</w:dataGrid>
		</layout:panel>
	</w:page>
</f:view>